// const { defineConfig } = require('@vue/cli-service')
// const path = require("path");
// function resolve(dir) {
//   return path.join(__dirname, dir);
// }
// module.exports = defineConfig({
//   transpileDependencies: true,
//   devServer:{
//     open:true,
//     host:"localhost"
//   },
//   chainWebpack: config => {
//     config.resolve.alias
//       .set("@", resolve("src"))
//       .set("@assets", resolve("src/assets"))
//       .set("@components", resolve("src/components"))
//       .set("@base", resolve("baseConfig"))
//       .set("@public", resolve("public"));
//   },
// })

const path = require('path')

function resolve(dir) {
  return path.join(__dirname, dir)
}


module.exports = {

  devServer: {
    open: true,
    port: 8000,
    proxy: {
      '/api': {
        target: "http://localhost:8000",
        changeOrigin: true, //允许跨域
        pathRewrite: {
          "^/api": ''
        }
      }
    }
  },
   chainWebpack: (config) => {
     config.resolve.alias
       .set('@', resolve('.src'))

   }

}